#ifndef MSG_RELAY_H
#define MSG_RELAY_H
#include "QThread"
#include "thread.h"
#include "QtCore"
#include "inner_msg.h"
#include "server_sql.h"
/*
 * 这个类负责接受所有用户发来的指令，并根据数据库的返回
*/
class Inner_Msg;
class Msg_Relay:QObject
{
    Q_OBJECT
public:
    static Msg_Relay* gethand()
    {
        if(global_Relay == nullptr)
            global_Relay = new Msg_Relay();
        return global_Relay;
    }
    void Add_Message(Inner_Msg *Msg);
    void Send();
private:
    explicit Msg_Relay(QObject *parent = nullptr);
    void GetClients(Inner_Msg *Msg);
    static Msg_Relay * global_Relay;
};
#endif // MSG_RELAY_H
